package com.lovo.cloud.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.redisson.config.SingleServerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author luo
 * @description
 * @date 2020/12/8 17:33
 */
@Configuration
public class RedisConfig {

    @Bean
    public RedissonClient redisson() {
        Config config = new Config();
        SingleServerConfig singleServerConfig = config.useSingleServer();
        singleServerConfig.setAddress("redis://127.0.0.1:" + 8001);
        singleServerConfig.setTimeout(300);
        singleServerConfig.setPassword("123456");
        return Redisson.create(config);
    }

}
